<?php 

include '../function.php';

$dsn = "mysql:host=localhost;dbname=school";
$username="root";
$password = "";

try{
	$pdo = new Pdo($dsn,$username,$password);
}catch(PDOException $e) {
	die($e->getMessage()); 
}

$pdo->query("SET NAMES 'utf8'");


$sth = $pdo->prepare('select * from stu where id = ?');

$id = 3;

$sth->bindParam(1, $id, PDO::PARAM_INT);

$sth->execute();

$row = $sth->fetchAll();


var_dump($row);


 ?>